﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MbUnit.Framework;
using HFK.DxFluentUI.Utility;

namespace HFK.DxFluentUITest.Utility
{
  [TestFixture]
  public class HierarchyNamingStrategyTestFixture
  {
    [Test]
    public void TestMainView()
    {
      HierarchyNamingStrategy nameProvider = new HierarchyNamingStrategy();
      string name = nameProvider.GetNextViewName(null, 0);

      Assert.IsFalse(string.IsNullOrEmpty(name));
      //Assert.AreEqual(0, HierarchyNamingStrategy.GetViewLevel(name));
      //Assert.IsNull(HierarchyNamingStrategy.GetParentViewName(name));
    }

    [Test]
    public void TestFirstLevel()
    {
      List<string> usedNames = new List<string>();   
      HierarchyNamingStrategy nameProvider = new HierarchyNamingStrategy();
      string name0 = nameProvider.GetNextViewName(null, 0);
      usedNames.Add(name0);
      string name11 = nameProvider.GetNextViewName(name0, 1);

      CollectionAssert.DoesNotContain(usedNames, name11);
      Assert.IsFalse(string.IsNullOrEmpty(name11));
      //Assert.AreEqual(0, HierarchyNamingStrategy.GetViewLevel(name11));
      //Assert.IsNull(HierarchyNamingStrategy.GetParentViewName(name11));
    }
  }
}
